﻿// -------------------------------------------------------------------------
//    @FileName         :    NFOnlineRewardPart.cpp
//    @Author           :    gaoyi
//    @Date             :    2025/1/7
//    @Email            :    445267987@qq.com
//    @Module           :    NFOnlineRewardPart
//
// -------------------------------------------------------------------------

#include "NFOnlineRewardPart.h"

#include "proto_db.pb.h"

NFOnlineRewardPart::NFOnlineRewardPart()
{
    if (EN_OBJ_MODE_INIT == NFShmMgr::Instance()->GetCreateMode())
    {
        CreateInit();
    }
    else
    {
        ResumeInit();
    }
}

NFOnlineRewardPart::~NFOnlineRewardPart()
{
}

int NFOnlineRewardPart::CreateInit()
{
    return 0;
}
    
int NFOnlineRewardPart::ResumeInit()
{
    return 0;
}

int NFOnlineRewardPart::LoadFromDB(const proto_ff::tbRoleDetail* pDBData)
{
    m_stData.FromPb(pDBData->role_base_data().online_reward());
    return 0;
}

int NFOnlineRewardPart::InitConfig(proto_ff::tbRoleDetail* pDbData, const RoleOne& stRoleOne)
{
    auto pData = pDbData->mutable_role_base_data()->mutable_online_reward();
    pData->set_reward_num(0);
    pData->set_is_get_reward(true);
    pData->set_last_op_time( NF_ADJUST_TIMENOW());
    return 0;
}

int NFOnlineRewardPart::SaveDB(proto_ff::tbRoleDetail* pDBData)
{
    m_stData.ToPb(pDBData->mutable_role_base_data()->mutable_online_reward());
    return 0;
}

int NFOnlineRewardPart::MakePlayerDataCS(proto_ff::Proto_CSGetRoleRsp* pCSGetRoleRsp)
{
    return 0;
}

int NFOnlineRewardPart::MakeCityPlayerData(proto_ff::CityRoleInfo* pGCCityRoleInfo)
{
    return 0;
}
